package com.jlpay.openapi.demo.ledger.balancesplit;

import com.jlpay.open.jlpay.sdk.java.model.ledger.request.BalanceSplitQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.ledger.response.BalanceSplitQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author dengwenning
 * @since 2024/8/30
 **/
public class BalanceSplitQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(BalanceSplitQueryService.class);

    public static void main(String[] args) {
        BalanceSplitQueryRequest balanceSplitQueryRequest = buildBalanceSplitQueryRequest();
        BalanceSplitQueryResponse balanceSplitQueryResponse = JlpayOpenApiService.openMerchService()
                .post(balanceSplitQueryRequest, BalanceSplitQueryResponse.class);
        LOGGER.info("余额分账请求响应:{}", JsonUtils.toString(balanceSplitQueryResponse));
    }

    private static BalanceSplitQueryRequest buildBalanceSplitQueryRequest() {
        BalanceSplitQueryRequest balanceSplitQueryRequest = new BalanceSplitQueryRequest();
        balanceSplitQueryRequest.setOrgCode("50720711");
        balanceSplitQueryRequest.setOutOrderNo("045e1314f7784f46bf9d590dc65c7");
        return balanceSplitQueryRequest;
    }
}
